home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / Makefile < prev    next >
Makefile  |  1998-09-15  |  2KB  |  116 lines

  1. # @(#)Makefile    1.12 97/12/01 David Connelly
  2. #
  3. # Standalone NMAKE makefile to build the programs 'jre.exe' and 'jrew.exe'
  4. # for launching Java runtime applications. The program 'jre.exe' can be
  5. # used to run console-based Java applications, and 'jrew.exe' will run
  6. # applications detached from the console. The sources to these programs
  7. # are also provided to demonstrate how JNI can be used to invoke Java
  8. # applications.
  9. #
  10.  
  11. #
  12. # Default version of Java runtime to use at startup.
  13. #
  14. !ifndef VERSION
  15. VERSION = $(RELEASE)
  16. !endif
  17.  
  18. #
  19. # Default locations of shared and win32-specific JRE sources.
  20. #
  21. !ifndef SHARE_JRE
  22. SHARE_JRE = ..
  23. !endif
  24. !ifndef WIN32_JRE
  25. WIN32_JRE = .
  26. !endif
  27.  
  28. #
  29. # It's unfortunate that the Windows 95 and NT command shells have to
  30. # be so much different...
  31. #
  32. !if "$(OS)" == "Windows_NT"
  33. DEL   = del/f/q
  34. RMDIR = rmdir/s/q
  35. !else
  36. DEL   = deltree/y
  37. RMDIR = deltree/y
  38. !endif
  39.  
  40. #
  41. # Use nmake -DDEBUG to build executables with debug symbols. These will
  42. # be named 'jre_g.exe' and 'jrew_g.exe'.
  43. #
  44. !ifdef DEBUG
  45. G = _g
  46. !else
  47. G =
  48. !endif
  49. OBJ = obj$G
  50.  
  51. #
  52. # Standard includes and defines
  53. #
  54. INCLUDES = -I$(SHARE_JRE) -I$(WIN32_JRE)
  55. DEFINES  = -DWIN32_LEAN_AND_MEAN -DVERSION=\"$(VERSION)\"
  56.  
  57. #
  58. # Microsoft Visual C++ 4.x compiler and linker flags
  59. #
  60. BASECFLAGS = -nologo -MD $(DEFINES) $(INCLUDES) $(EXTRA_CFLAGS)
  61. BASELFLAGS = -nologo $(EXTRA_LFLAGS)
  62. !ifdef DEBUG
  63. CFLAGS = -Zi -Od -DDEBUG $(BASECFLAGS)
  64. LFLAGS = -debug
  65. !else
  66. CFLAGS = -Ox -G5 $(BASECFLAGS)
  67. !endif
  68. LIBS = setargv.obj advapi32.lib user32.lib
  69.  
  70. #
  71. # These are the objects to build both jre.exe and jrew.exe
  72. #
  73. JRE_obj =   $(OBJ)\jre_main.obj    \
  74.         $(OBJ)\jre.obj    \
  75.         $(OBJ)\jre_md.obj
  76.  
  77. #
  78. # Default target to build both jre.exe and jrew.exe. The only difference
  79. # is the use of the -subsystem flag to specify whether or not to run
  80. # detached from a console.
  81. #
  82.  
  83. jre : $(OBJ) jre$G.exe jrew$G.exe
  84.  
  85. jre$G.exe : $(JRE_obj)
  86.     link -subsystem:console -out:jre$G.exe $(LFLAGS) $** $(LIBS)
  87.  
  88. jrew$G.exe : $(JRE_obj)
  89.     link -subsystem:windows -out:jrew$G.exe $(LFLAGS) $** $(LIBS)
  90.  
  91. $(JRE_obj) : $(SHARE_JRE)\jre.h $(WIN32_JRE)\jre_md.h
  92.  
  93. #
  94. # Default rules
  95. #
  96.  
  97. {$(WIN32_JRE)}.c{$(OBJ)}.obj :
  98.         $(CC) $(CFLAGS) -c -Fo$@ $<
  99.  
  100. {$(SHARE_JRE)}.c{$(OBJ)}.obj :
  101.         $(CC) $(CFLAGS) -c -Fo$@ $<
  102.  
  103. #
  104. # Directory setup and cleanup
  105. #
  106.  
  107. $(OBJ) :
  108.     mkdir $(OBJ)
  109.  
  110. clean :
  111.     -$(RMDIR) $(OBJ)
  112.     -$(RMDIR) $(OBJ)_g
  113.     -$(DEL) *.exe
  114.     -$(DEL) *.ilk
  115.     -$(DEL) *.pdb
  116.